export default {
    name: 'TableSlot',
    functional: true,
    inject: ['applyTable'],
    props: {
        name: null,
        column: {
            type: Object,
            default: null
        },
        columns: null
    },
    render: (h, ctx) => {
        console.log('render',ctx.props.column,ctx.injections.applyTable.$scopedSlots);
        return h('slot', [
            ctx.injections.applyTable.$scopedSlots[name]({
                row: ctx.props.column.row
            })
        ]);
    }
    /*render: (h, ctx) => {
        let api = [];
        let cs = ctx.props.columns;
        for(let i = cs.length; i--;){
            let col = cs[i];
            if(col.slot) {
                console.log(col);
                let scopedSlots = {};
                scopedSlots[col.slot] = function({row}){
                    console.log('api',row);
                    return h('div', [
                        ctx.injections.applyTable.$scopedSlots[col.slot]({row:row})
                    ])
                };
                api.push(h('div', {
                    scopedSlots: scopedSlots
                }))
            }
        };
        return api;
    }*/
};